home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / DB_CLIPP / 0769B.ZIP / CLEARBUF.PRG < prev    next >
Text File  |  1986-04-13  |  3KB  |  71 lines

  1.  
  2.  
  3. ************************
  4. * Name     CLEARBUF.prg
  5. * Date     10/30/85
  6. * Author   Steve Straley
  7. * Note     This program will demonstrate how the keyboard buffer can be
  8. *          cleared in your programs.  The statement CALL _cclr is
  9. *          the actual command which clears the keyboard buffer.
  10. *
  11. *          To really see the difference between the two test sets, try
  12. *          entering characters (even the return key) as fast as you can.
  13. *          On the first set, the frames should go by quickly especially if
  14. *          the return key was pushed 4 or 5 times in rapid succession.
  15. *          However, on the second set, notice that even though the return
  16. *          key is hit several times, the prompt to hit any key stops and
  17. *          waits for a respons.   This difference is due to the keyboard
  18. *          buffer being cleared.
  19. ***********************
  20.  
  21. CLEAR
  22. looping = .T.
  23. DO WHILE looping
  24.    input_it = "1"
  25.    @  1,18 SAY "Please type in numbers as fast as possible."
  26.    @ 2,0,21,79 BOX CHR(177)
  27.    @ 12,30 SAY "Any Key for next screen..." GET input_it
  28.    READ
  29.    @ 2,0,21,79 BOX CHR(222) + CHR(223) + CHR(221) + CHR(221) ;
  30.                  + CHR(221) + CHR(220) + CHR(222) + CHR(222) + " "
  31.    @ 12,30 SAY "Any Key for next screen..." GET input_it
  32.    READ
  33.    @ 2,0,21,79 BOX CHR(42)
  34.    @ 12,30 SAY "Any Key for next screen..." GET input_it
  35.    READ
  36.    @ 2,0,21,79 BOX CHR(201) + CHR(205) + CHR(187) + CHR(186) ;
  37.                  + CHR(188) + CHR(205) + CHR(200) + CHR(186) + " "
  38.    @ 12,30 SAY "Any Key for next screen..." GET input_it
  39.    READ
  40.    @ 24,10 SAY "Would you like to try this again?  " GET looping
  41.    READ
  42. ENDDO
  43. CLEAR
  44. looping = .T.
  45. DO WHILE looping
  46.    input_it = "1"
  47.    @  1,18 SAY "Please type in numbers as fast as possible."
  48.    @ 2,0,21,79 BOX CHR(177)
  49.    @ 12,30 SAY "Any Key for next screen..." GET input_it
  50.    CALL _cclr
  51.    READ
  52.    @ 2,0,21,79 BOX CHR(222) + CHR(223) + CHR(221) + CHR(221) ;
  53.                  + CHR(221) + CHR(220) + CHR(222) + CHR(222) + " "
  54.    @ 12,30 SAY "Any Key for next screen..." GET input_it
  55.    CALL _cclr
  56.    READ
  57.    @ 2,0,21,79 BOX CHR(42)
  58.    @ 12,30 SAY "Any Key for next screen..." GET input_it
  59.    CALL _cclr
  60.    READ
  61.    @ 2,0,21,79 BOX CHR(201) + CHR(205) + CHR(187) + CHR(186) ;
  62.                  + CHR(188) + CHR(205) + CHR(200) + CHR(186) + " "
  63.    @ 12,30 SAY "Any Key for next screen..." GET input_it
  64.    CALL _cclr
  65.    READ
  66.    @ 24,10 SAY "Would you like to try this again?  " GET looping
  67.    CALL _cclr
  68.    READ
  69. ENDDO
  70.  
  71. --End--